import os
def getSSID():
	command = os.popen('netsh wlan show interfaces | find "SSID"')
	info = command.read()

	if info == '':
		#print('wlan not connected...')
		return
	else:
		info = info.replace(' ','')
		info = info.split('\n')
		info.remove('')

		for i in range(len(info)):
			if info[i].find('BSSID') != -1:
				del info[i]
				break

		res = info[0].split(':')[1]
		#print(res)
		return res

ssid = getSSID()
